package GUIMain;

import mail_operations.MailerGUI;
import profileEditor.ProfileEditor;
import profileEditor.RuleEditor;
import storage.FieldInfo;
import data.EmployeeInfo;
import data.FilePath;
import data.ProfileList;
import data.ProgramClock;
import data.Reference;
import data.TopOceanInfo;
import employeeOperations.SelectEmployeeDialog;
import fileIO.ConfigIO;

public class GUILoader {
	
	private static ProgramClock pc;
	/**
	 * @param args
	 */
	public static void initialize() {
		SplashScreen ss = new SplashScreen();
		pc = new ProgramClock();
		Thread ct = new Thread(pc);
		ct.start();
		ss.open();
		ss.update(7,"Loading Config");
		ConfigIO.loadConfig();
		ss.update(7, "Setting Window Properties");
		GUIFocusManager.initialize();
		ss.update(7, "Loading Field Data");
		FieldInfo.initialize();
		ss.update(7, "Loading Employee Data");
		EmployeeInfo.initialize();
		ss.update(7, "Initializing Employee Editor");
		EmployeeEditor.initialize();
		ss.update(7, "Initializing File Browser");
		FileChooser.initialize();
		ss.update(7, "Initializing Mail Editor");
		MailerGUI.initialize();
		ss.update(7, "Initializing Topocean Data");
		TopOceanInfo.initialize();
		ss.update(7, "Loading Customer Profiles");
		ProfileList.initialize();
		ss.update(7, "Loading Reference Data");
		Reference.initialize();
		ss.update(7, "Loading Rule Data");
		RuleEditor.initialize();
		ss.update(7, "Initializing Employee Editor");
		SelectEmployeeDialog.initialize();
		ss.update(7, "Loading Profile Editor");
		ProfileEditor.initialize();
		ss.update(7, "Loading File Path Data");
		FilePath.initialize();
		ss.update(7, "Launching Program...");
		SetupAndDisplayGUI.setupGUI();
	}
	
	public static ProgramClock getClock(){
		return pc;
	}
}
